package com.xxzuibang.day9.this关键字;

public class This_01 {
    public static void main(String[] args) {
        Dog dog = new Dog("大黄", 50);
        dog.showInfo();
        Dog dog1=new Dog("小王",18);
        dog1.showInfo();
        System.out.println("dog的hashcode的值为" + dog.hashCode());
        System.out.println("dog1的hashcode的值为" + dog1.hashCode());
    }
}

class Dog {
    String name;//成员变量 名字
    int age;//年龄

    public Dog(String name, int age) {
        //表示当前对象调用的name
        this.name = name;
        //表示当前对象调用的age
        this.age = age;
    }

    public void showInfo() {
        System.out.println("名字为" + name + "年龄为" + age);
    }


}
